package net.uhuijia.sys.syscode.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import net.uhuijia.sys.syscode.service.SysCodeService;
import net.uhuijia.utils.StringHelper;
import net.uhuijia.vo.ResultMapVo;
import net.uhuijia.vo.sys.code.CodeVo;


@RestController
@RequestMapping(value="/syscode")
public class SysCodeController{

	@Autowired
    private SysCodeService sysCodeService;
    
    @RequestMapping(value = "/getCodesByType")
   	public ResultMapVo<List<CodeVo>> getCodesByType( String type )
   	{
    	if( StringHelper.isNotBlanks(type) ){
    		return ResultMapVo.ok(sysCodeService.getCodesByType(type));
    	}else{
    		throw new IllegalArgumentException();
    	}
       	
   	}

}